package com.zimin.cloud.system.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zimin.cloud.mine.pojo.system.business.PostBO;
import com.zimin.cloud.system.biz.IPostBiz;
import com.zimin.cloud.system.controller.api.IPostController;
import com.zimin.cloud.system.pojo.entity.Post;
import com.zimin.shared.pojo.BaseController;
import com.zimin.shared.pojo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 岗位信息 前端控制器
 * </p>
 *
 * @author zimin
 * @since 2021-12-30 11:05
 */
@RestController
public class PostController extends BaseController implements IPostController {


    @Autowired
    private IPostBiz postBiz;

    @Override
    public Result postPageList(Page<Post> postPage, PostBO postBO) {
        return result(postBiz.pagePostList(postPage, postBO));
    }

    @Override
    public Result allPost() {
        return result(postBiz.allPost());
    }

    @Override
    public Result save(PostBO postBO) {
        return result(postBiz.save(postBO));
    }

    @Override
    public Result update(PostBO postBO) {
        return result(postBiz.updateById(postBO));
    }

    @Override
    public Result delete(List<String> idList) {
        return result(postBiz.removeByIds(idList));
    }

}
